﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using AFCEPF.BankApplication.BLL;
using NUnit.Framework;

namespace AFCEPF.BankApplication.Tests
{
    
    [TestFixture]
    class Test_MonthlyFeesVisitor
    {
        IVisitor _visitor;

        [SetUp]
        public void SetUp()
        {
            _visitor = new MonthlyFeesVisitor();
        }


        [Test]
        public void Test_Method_Visit_OnSimpleAccount()
        {
            // Let's create a SimpleAccount via 
            // our factory class.
            AccountBase target = Bank.Instance.Accounts.Create(new Customer("toto"), 
                                                               AccountFactory.MIN_DEPOSIT_FOR_SIMPLE + 1);

            // We pass the IVisitor object to the 
            // IVisitable object, and let it do its work..
            target.Accept(_visitor);

            double expected = AccountFactory.MIN_DEPOSIT_FOR_SIMPLE;
            Assert.AreEqual(expected, target.Balance);

        }


        [Test]
        public void Test_Method_Visit_OnSilverAccount()
        {
            // Let's create a SimpleAccount via 
            // our factory class.
            AccountBase target = Bank.Instance.Accounts.Create(new Customer("toto"), 
                                                                AccountFactory.MIN_DEPOSIT_FOR_SILVER + 2);

            // We pass the IVisitor object to the 
            // IVisitable object, and let it do its work..
            target.Accept(_visitor);

            double expected = AccountFactory.MIN_DEPOSIT_FOR_SILVER;

            Assert.AreEqual(expected, target.Balance);

        }

        [Test]
        public void Test_Method_Visit_OnGoldAccount()
        {
            // Let's create a SimpleAccount via 
            // our factory class.
            AccountBase target = Bank.Instance.Accounts.Create(new Customer("toto"), 
                                                                AccountFactory.MIN_DEPOSIT_FOR_GOLD + 3);

            // We pass the IVisitor object to the 
            // IVisitable object, and let it do its work..
            target.Accept(_visitor);

            double expected = AccountFactory.MIN_DEPOSIT_FOR_GOLD;

            Assert.AreEqual(expected, target.Balance);

        }


    }
}
